#pragma once

#include <functional>
#include "details/rb_tree.h"

template<typename Key, 
    typename Cmp = std::less<Key>,
    typename Alloc = std::allocator<Key>>
class Set
{
public:
    Set() = default;
    Set(const Set &) = default;
    Set(Set &&) = default;
    ~Set() = default;

public:
    using RepType = RBTree<Key, Key>;
    using Iterator = typename RepType::Iterator;
    using ConstIterator = typename RepType::ConstIterator;
    using InsertReturnType = typename RepType::InsertReturnType;
    using SizeType = typename RepType::size_type;

public:
    InsertReturnType
    insert(const Key &k)
    { return m_t.insertUnique(k); }

    SizeType
    erase(const Key &k)
    { return m_t.erase(k); }

    ConstIterator
    find(const Key &k)
    { return m_t.find(k); }

    void
    clear()
    { m_t.clear(); }

    SizeType
    size() const
    { return m_t.size(); }

    Iterator
    begin() const
    { return m_t.begin(); }

    Iterator
    end()
    { return m_t.end(); }

    Iterator
    lowerBound(const Key &k) const
    { return Iterator(); }

private:
    RepType m_t;
};